i18n: Fix untranslated strings in views and errors#152
Merged
tmorrell merged 2 commits intoinveniosoftware:masterfrom Jun 9, 2025
Merged
i18n: Fix untranslated strings in views and errors#152tmorrell merged 2 commits intoinveniosoftware:masterfrom
tmorrell merged 2 commits intoinveniosoftware:masterfrom
Conversation
There are untranslated permission and usage errors in views.py and errors.py. This commit fixes those by using `gettext` from invenio-i18n. Co-authored-by: Miroslav Simek <[email protected]>
Samk13
approved these changes
Jan 31, 2025
Replaced gettext("...{aaa}...").format(aaa=) pattern with gettext("...%(aaa)s...", aaa=)
to be more consistent with lazy_gettext uses.
Samk13
reviewed
Feb 21, 2025
Comment on lines
+75
to
+77
| self.description = _( | ||
| "Unknown statistic '%(query_name)s'", query_name=query_name | ||
| ) |
Member
There was a problem hiding this comment.
Question: Did you try if this style works with gettext, or should we use the following instead?
Suggested change
| self.description = _( | |
| "Unknown statistic '%(query_name)s'", query_name=query_name | |
| ) | |
| self.description = _( | |
| "Unknown statistic '%(query_name)s'" | |
| ) % { "query_name": query_name } |
The same question applies to the rest of the strings with gettext.
Contributor
Author
Contributor
Author
utnapischtim
approved these changes
Mar 19, 2025
Contributor
|
Tests have been fixes in master and aren't related to translations. CI should work after merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
There are untranslated permission and usage errors in views.py and errors.py.
This PR fixes those by using
gettextfrom invenio-i18n.Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
Frontend
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: